//
//  MainLoginViewController.m
//  CNKICommunity
//
//  Created by wei on 17/3/6.
//  Copyright © 2017年 CNKI. All rights reserved.
//

#import "MainLoginViewController.h"
#import "RegistViewController.h"
#import "SubjectSelectViewController.h"
#import "MMDrawerController.h"
#import "CNKITabViewController.h"
@interface MainLoginViewController ()
@property(nonatomic,strong)MMDrawerController *drawerController;
@end

@implementation MainLoginViewController
- (void)viewDidLoad {
    [super viewDidLoad];

    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(100, 200, 80, 50);
    [btn setTitle:@"注册" forState:UIControlStateNormal];
    btn.font = [UIFont systemFontOfSize:17];
    [btn setBackgroundColor:[UIColor darkGrayColor]];
    [btn setTintColor:[UIColor whiteColor]];
    [self.view addSubview:btn];
    [btn addTarget:self action:@selector(jumpNextPage) forControlEvents:UIControlEventTouchUpInside];
    
    
    UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn1.frame = CGRectMake(100, 270, 80, 50);
    [btn1 setTitle:@"登录" forState:UIControlStateNormal];
    btn1.font = [UIFont systemFontOfSize:17];
    [btn1 setBackgroundColor:[UIColor darkGrayColor]];
    [btn1 setTintColor:[UIColor whiteColor]];
    [self.view addSubview:btn1];
    [btn1 addTarget:self action:@selector(jumpMainTabbar) forControlEvents:UIControlEventTouchUpInside];
    
}


-(void)jumpNextPage
{
     RegistViewController *RegistVC = [[RegistViewController alloc] init];
    [self presentViewController:RegistVC animated:YES completion:nil];
}
-(void)jumpMainTabbar
{
    CNKITabViewController *TabVC = [[CNKITabViewController alloc] init];
    SubjectSelectViewController *SubjectSelectVC = [[SubjectSelectViewController alloc]init];
    TabVC = [[CNKITabViewController alloc] init];
    self.drawerController = [[MMDrawerController alloc] initWithCenterViewController:TabVC  leftDrawerViewController:SubjectSelectVC];
    [self.drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeNone];
    [self.drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];
    [self.drawerController setMaximumLeftDrawerWidth:SCREENWIDTH - 50];

    __weak typeof(self)weakself = self;
    [self presentViewController:_drawerController animated:YES completion:^{
        [UIApplication sharedApplication].keyWindow.rootViewController = weakself.drawerController;
    }];
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

@end
